<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/jeecms_sys/head.html"/>
<script type="text/javascript">
var messageBox;
var percent;
function getTableForm() {
	return document.getElementById('tableForm');
}

function optDelete() {
	if(Pn.checkedCount('ids')<=0) {
		$.alert("<@s.m 'global.prompt'/>","<@s.m 'error.checkRecord'/>");
		return;
	}
	$.confirm(doDelete,"<@s.m 'global.confirm'/>","<@s.m 'global.confirm.delete'/>");
}
function doDelete(){
	var f = getTableForm();
	f.action="o_delete.do";
	f.submit();
}

function checkComplete(){
	$.post("v_check_complete.do",{},function(data){
		if(!data.completed){
			createProgress();
		}
	},"json");
}

function setBar(percent,infor, message) {
	$("#bar").attr("width",6*percent);
	$("#percent").html(percent + "%");
	infor.html(message);
}

function createProgress() {
	$.post("v_progress_data.do",{},function(data){
		$("#progressContainer").html(data);
		messageBox = $("#messageBox");
		if (percent >= 100){
			setBar(percent,messageBox, "<@s.m 'cmsAcquisition.complete'/>");
			checkComplete();
		}
		else {
		setBar(percent,messageBox, "<@s.m 'cmsAcquisition.acquiting'/>");
		setTimeout(createProgress, 1000);
		}
	});
}

$(function() {
	createProgress();
});
</script>
</head>
<body>
<div class="box-positon">
	<div class="rpos"><@s.m "global.position"/>: <@s.m "cmsAcquisition.function"/> - <@s.m "cmsAcquisition.progress"/></div>
	<div class="clear"></div>
</div>
<div id="progressContainer"></div>
<div class="body-box"></div>
</body>
</html>